package org.grayrabbit.cms.entity;

// Generated 2011-5-16 13:39:30 by Hibernate Tools 3.3.0.GA

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * CmsSurveySubject generated by hbm2java
 */
@Entity
@Table(name = "CMS_SURVEY_SUBJECT")
public class SurveySubject implements java.io.Serializable {

	private static final long serialVersionUID = -4166654139933451216L;
	private String subjectId;
	private Survey survey;
	private String subjectTitle;
	private Boolean subjectCheckModel;
	private String subjectOther;
	private Integer ord;
	private Set<OptionAnswer> optionAnswers = new HashSet<OptionAnswer>(
			0);
	private Set<SubjectOption> subjectOptions = new HashSet<SubjectOption>(
			0);

	public SurveySubject() {
	}

	public SurveySubject(String subjectId) {
		this.subjectId = subjectId;
	}

	@Id
	@Column(name = "SUBJECT_ID", unique = true, nullable = false, length = 32)
	@GeneratedValue(generator = "paymentableGenerator")       
	@GenericGenerator(name = "paymentableGenerator", strategy = "uuid") 
	public String getSubjectId() {
		return this.subjectId;
	}

	public void setSubjectId(String subjectId) {
		this.subjectId = subjectId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "SURVEY_ID")
	public Survey getSurvey() {
		return survey;
	}

	public void setSurvey(Survey survey) {
		this.survey = survey;
	}
	
	@Column(name = "SUBJECT_TITLE", length = 64)
	public String getSubjectTitle() {
		return this.subjectTitle;
	}

	public void setSubjectTitle(String subjectTitle) {
		this.subjectTitle = subjectTitle;
	}

	@Column(name = "SUBJECT_CHECK_MODEL", precision = 1, scale = 0)
	public Boolean getSubjectCheckModel() {
		return this.subjectCheckModel;
	}

	public void setSubjectCheckModel(Boolean subjectCheckModel) {
		this.subjectCheckModel = subjectCheckModel;
	}

	@Column(name = "SUBJECT_OTHER", length = 512)
	public String getSubjectOther() {
		return this.subjectOther;
	}

	public void setSubjectOther(String subjectOther) {
		this.subjectOther = subjectOther;
	}

	@Column(name = "ORD", precision = 6, scale = 0)
	public Integer getOrd() {
		return this.ord;
	}

	public void setOrd(Integer ord) {
		this.ord = ord;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "surveySubject")
	public Set<OptionAnswer> getOptionAnswers() {
		return optionAnswers;
	}

	public void setOptionAnswers(Set<OptionAnswer> optionAnswers) {
		this.optionAnswers = optionAnswers;
	}


	@OneToMany(fetch = FetchType.LAZY, mappedBy = "surveySubject")
	public Set<SubjectOption> getSubjectOptions() {
		return subjectOptions;
	}

	public void setSubjectOptions(Set<SubjectOption> subjectOptions) {
		this.subjectOptions = subjectOptions;
	}

}
